/*
 * GuildFraktionInfo - list the reputation and the guild level of all members of a wow guild
 * Copyright (C) [2012 - 2013] [www.marantis.de]
 * 
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public 
 * License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later 
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with this program; if not, 
 * see <http://www.gnu.org/licenses/>.
 */
package de.marantis.app.wow.gfi.helper;

public enum ReputationEnum {

    error(-2), //error
    undefined(-1), //undefiniert
    hated(0), //hasserfüllt
    hostile(1), //feindselig
    unfriendly(2), //unfreundlich
    neutral(3), //neutral
    friendly(4), //freundlich
    honoured(5), //wohlwollend
    revered(6), //respektvoll
    exalted(7); //ehrfürchtig
    
    private int rep;

    ReputationEnum(int rep) {
        this.rep = rep;
    }

    public int getRep() {
        return rep;
    }

    public int getRepLevel() {
        return rep;
    }

    public void setRep(int rep) {
        this.rep = rep;
    }

    public static ReputationEnum getNewWithInt(int rep) throws IllegalArgumentException {
        for (ReputationEnum e : ReputationEnum.values()) {
            if (e.getRep() == rep) {
                return e;
            }
        }

        throw new IllegalArgumentException("Invalid integer value for enum!");
    }
}
